@layout("/common/_container.html"){
<script>
    var all = 0;
</script>
<div class="ibox float-e-margins">
    <div class="ibox-content">
        <div class="ibox float-e-margins">
            <div class="ibox-title">
                <h5>${title}款项确认</h5>
            </div>
        </div>
        <input type="hidden" id="id" value="${item.id}">
        <input type="hidden" id="mode" value="${item.mode}">
        <input type="hidden" id="is_transfer" value="${item.isTransfer}">
        <input type="hidden" id="sendDeptName" value="${item.sendDeptName}">
        <input type="hidden" id="dotId" value="${item.dotId}">
        <div class="form-horizontal">

            <div class="col-sm-4  b-r" style="text-align: right">
                <#input id="id" name="单号"  readonly="readonly" value="${item.original_num}" />
                <#input id="goodsName" name="物品名称" value="${item.goodsName}" readonly="readonly" />
                <#input id="goodsPiece" name="件数" value="${item.goodsPiece}" readonly="readonly" />
                <#input id="createtime" name="入库时间" value="${item.createtime}" readonly="readonly" />
            </div>
            <div class="col-sm-4  b-r" style="text-align: right">
                <#input id="consignee" name="收货人" value="${item.consignee}" readonly="readonly" />
                <#input id="goodsWeight" name="重量/T" value="${item.goodsWeight}" readonly="readonly" />
                <#input id="payment" name="提付" value="${item.payment}" readonly="readonly" />
                <#input id="payment" name="库存时长" value="${days}" readonly="readonly" />
            </div>
            <div class="col-sm-4  b-r" style="text-align: right">
                <#select id="modeType" name="交货方式" >
                    <option value="1">自提</option>
                    <option value="2">配送</option>
                    <option value="3">中转</option>
                </#select>
                <#input id="goodsVolume" name="体积/M3" value="${item.goodsVolume}" readonly="readonly"/>
                <#input id="collection" name="代收货款" value="${item.collection}" readonly="readonly" />
                <#input id="backAmount" name="返款" value="${item.collection}" readonly="readonly" />

            </div>

        </div>
        <div class="row">
            <div class="col-sm-12" style="text-align: left">
                选择费用项目：
            </div>
        </div>
        <div class="row">
            <input type="hidden" id="transfer_name" value="${item.transfer_name}">
            <input type="hidden" id="reallyUser" value="${item.reallyUser}">
            @for(fee in list){
            <div class="col-sm-1" style="text-align: left;width: 127px">
                <div class="checkbox checkbox">
                    <input id="${fee.id}_check" class="styled" type="checkbox" name="is_out" value="${fee.id}"
                           onchange="TOrderInfoDlg.addLine(this.value,this)"
                    >
                    <label for="${fee.id}_check" class="font-bolder">
                        ${fee.fee_name}
                    </label>
                </div>
            </div>
            <input type="hidden" id="${fee.id}_type" value="${fee.payments_type}">
            <input type="hidden" id="${fee.id}_object" value="${fee.use_object}">
            <input type="hidden" id="${fee.id}_labe" value="${fee.fee_name}">
            @}
        </div>
        <table class="table-striped layui-table mtd" id="table" style="width: 100%;border: 1px solid darkgrey">
            <thead>
            <td>款项</td>
            <td>收支</td>
            <td>交易对象</td>
            <td>金额</td>
            <td>结算方式</td>
            <td>操作</td>
            </thead>
            @for(feeOrder in feeOrders){
            <tr id="${feeOrder.fee_id}_tr">
                <td>${feeOrder.fee_name}</td>
                <td>${feeOrder.feeIncome}
                    <input value="${feeOrder.fee_Income}" id="${feeOrder.fee_id}_ff" type="hidden">
                </td>
                <td>
                    @if(feeOrder.use_object == "3"){
                        ${item.consignee}
                        <input value="${feeOrder.money}" name="js_money" type="hidden">
                    @}else if(feeOrder.use_object == "2"){
                        ${item.sendDeptName}
                    @}else if(feeOrder.use_object == "4"){
                        ${item.transfer_name}
                    @}else if(feeOrder.use_object == "5"){
                        ${item.reallyUser}
                    @}
                    <input value="${feeOrder.fee_id}" name="feeId" type="hidden" id="${feeOrder.fee_id}">
                    <input value="${feeOrder.use_object}" type="hidden" id="${feeOrder.fee_id}_use_object">
                </td>
                <td>
                    @if(feeOrder.audit_status==0){
                    @if(feeOrder.use_object == "3"){
                    <input value="${feeOrder.money}" name="cur_money" id="${feeOrder.fee_id}_m" type="text"
                           onkeyup="TOrderInfoDlg.changeMoney(${feeOrder.fee_id})">
                    @}else{
                    <input value="${feeOrder.money}" name="cur_money" id="${feeOrder.fee_id}_m" type="text">
                    @}

                    @}else{
                    <input value="${feeOrder.money}" name="cur_money" id="${feeOrder.fee_id}_m" type="text" readonly>
                    @}

                    <input value="${feeOrder.sy}" id="${feeOrder.fee_id}_t" type="hidden">

                </td>
                <td>
                    @if(feeOrder.audit_status==0){
                    @if(feeOrder.use_object == "3"){
                    <select id="${feeOrder.fee_id}_s" onchange="TOrderInfoDlg.Calculation()">
                        <option value="0" selected="selected">当场结算</option>
                        <option value="1">等待月结</option>
                    </select>
                    @}else{
                    <select id="${feeOrder.fee_id}_s">
                        <option value="0" selected="selected">当场结算</option>
                        <option value="1">等待月结</option>
                    </select>
                    @}

                    @}else{
                    ${feeOrder.settlementType}
                    <input value="1" id="${feeOrder.fee_id}_s" type="hidden">
                    @}
                </td>
                <td>
                    @if(feeOrder.audit_status==0){
                    <button class="btn-danger" onclick="TOrderInfoDlg.delLine(${feeOrder.fee_id})">删除</button>
                    @}
                </td>
            </tr>
            @}
        </table>
        <div class="row" style="margin-top: 10px;display: none">
            <div class="col-sm-3">
                <#SelectCon id="pay_mode" name="付款方式" >
                    <option value="0">现金</option>
                    <option value="1">支付宝</option>
                    <option value="2">微信</option>
                    <option value="3">银行转账</option>
                    <option value="4">其他</option>
                </#SelectCon>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-2" style="text-align: right">
                合计收支（￥）：
            </div>
            <div class="col-sm-10" style="text-align: left">
                <input id="all_money" type="text" readonly style="border: none">
            </div>
        </div>
        <div class="row">
            <div class="col-sm-2" style="text-align: right">
                ${item.consignee} 收支（￥）：
            </div>
            <div class="col-sm-2" style="text-align: left">
                <input id="sz_money" type="text" readonly style="border: none">
            </div>
            <div class="col-sm-2" style="text-align: right">
                ${item.consignee} 挂账（￥）：
            </div>
            <div class="col-sm-6" style="text-align: left">
                <input id="gz_money" type="text" readonly style="border: none">
            </div>
        </div>

        <div class="form-horizontal" id="dotInfoForm">

            <div class="row">

            </div>
            <div class="row btn-group-m-t">
                <div class="col-sm-10">
                    <#button btnCss="info" name="确认款项" id="ensure" icon="fa-check" clickFun="TOrderInfoDlg.addSubmit()"/>
                    <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TOrderInfoDlg.close()"/>
                </div>
            </div>
        </div>

    </div>
</div>
<style>
    table {
        table-layout: fixed;
        word-wrap: break-word;
    }

    .mtd td {
        height: 30px;
        border: #CCCCCC 1px solid;
        text-align: center
    }
    table input{
        border: none;
        height: 100%;
        background-color: transparent;

    }
    table select{
        border: none;
        height: 100%;
        background-color: transparent;
    }
</style>
<script src="${ctxPath}/static/modular/system/tOrder/superOrder/tOrder_library_info.js"></script>
@}
